package com.healthcloud.dao;

import com.healthcloud.entity.SysUserEntity;
import com.healthcloud.utils.PageParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * Created by yu on 2017/6/6.
 */
public interface SysUserDao extends BaseDao<SysUserEntity>{


    List<SysUserEntity> search(@Param("entity") SysUserEntity entity, @Param("pageParam")PageParam pageParam);

    /**
     * 查询用户的所有权限
     * @param entity  用户名
     */
    List<String> queryAllPerms(@Param("entity") SysUserEntity entity);

    /**
     * 查询用户的所有菜单ID
     */
    List<Long> queryAllMenuId(Long userId);

    /**
     * 根据用户名，查询系统用户
     */
    SysUserEntity queryByUserName(String username);

    /**
     * 根据手机号，查询系统用户
     * @param mobile
     * @return
     */
    SysUserEntity queryByMobil(String mobile);

    /**
     * 根据邮箱，查询系统用户
     * @param email
     * @return
     */
    SysUserEntity queryByEmail(String email);

    /**
     * 物理删除
     * @param id
     * @return
     */
    int logicalDelete(@Param("id") Long id);

    /**
     * 修改密码
     */
    int updatePassword(Map<String, Object> map);

    SysUserEntity getByOpenId(@Param("openId")String openId);
}
